package com.fare.taluo.vo.config.city;

import com.fare.taluo.GlobalsConst;

/**
 * 航线选择对象集合
 * @author xingsf
 *
 */
public class CityLineSelectVO {

	private String companyCode;
	
	private String companyName;

	private CitySelectVO fromCityVO;
	
	private CitySelectVO toCityVO;

	public CityLineSelectVO(){}

	public CityLineSelectVO(String companyCode, String companyName,
			CitySelectVO fromCityVO, CitySelectVO toCityVO) {
		super();
		this.companyCode = companyCode;
		this.companyName = companyName;
		this.fromCityVO = fromCityVO;
		this.toCityVO = toCityVO;
	}

	public String getCompanyCode() {
		return companyCode;
	}

	public void setCompanyCode(String companyCode) {
		this.companyCode = companyCode;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public CitySelectVO getFromCityVO() {
		return fromCityVO;
	}

	public void setFromCityVO(CitySelectVO fromCityVO) {
		this.fromCityVO = fromCityVO;
	}

	public CitySelectVO getToCityVO() {
		return toCityVO;
	}

	public void setToCityVO(CitySelectVO toCityVO) {
		this.toCityVO = toCityVO;
	}

	public String getAirLine(){
		return this.getFromCityVO().getName()+GlobalsConst.SEPARATOR_LINE+this.getToCityVO().getName();
	}
	public String getId(){
		return this.getFromCityVO().getCode()+GlobalsConst.SEPARATOR_LINE+this.getToCityVO().getCode();
	}
	
	public String getFirstLet(){
		return this.getFromCityVO().getShortSpell() != null ?
				this.getFromCityVO().getShortSpell().substring(0, 1).toUpperCase() : "";
	}
	
	public boolean getIsHot(){
		return this.getFromCityVO().isIshot() && this.toCityVO.isIshot();
	}
	@Override
	public String toString() {
		return "CityLineSelectVO [companyCode=" + companyCode
				+ ", companyName=" + companyName + ", fromCityVO=" + fromCityVO
				+ ", toCityVO=" + toCityVO + "]";
	}
}
